﻿<UserControl x:Class="Ezpay.UI.Views.AddServiceView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:c="clr-namespace:Ezpay.UI.Controls"
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                   xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                   xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
        Width="300">
    <c:AutoLayoutGrid CellPadding="3">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="Type:"/>
        <telerik:RadComboBox SelectedItem="{Binding SelectedServiceType}" ItemsSource="{Binding ServiceTypes}"/>
        <TextBlock Text="Description:" />
        <TextBox Text="{Binding Description, Mode=TwoWay}"/>
        
        <DockPanel LastChildFill="False" Grid.ColumnSpan="2">
            <telerik:RadButton Content="Cancel" DockPanel.Dock="Right" Width="80">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:ChangePropertyAction TargetObject="{Binding}" PropertyName="Result" Value="False"/>
                        <ei:ChangePropertyAction TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" PropertyName="DialogResult" Value="False"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </telerik:RadButton>
            <telerik:RadButton Content="Add" DockPanel.Dock="Right" Margin="0 0 10 0" Width="80">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:ChangePropertyAction TargetObject="{Binding}" PropertyName="Result" Value="True"/>
                        <ei:ChangePropertyAction TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" PropertyName="DialogResult" Value="True"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </telerik:RadButton>
        </DockPanel>
        
    </c:AutoLayoutGrid>
</UserControl>
